import Vue from "vue"
// 1. 引入路由模块
import VueRouter from 'vue-router'
// 2. 将VueRouter注册到Vue上
Vue.use(VueRouter)

// 引入组件文件
import home from './components/tabbar/Home.vue'
import search from './components/tabbar/Search.vue'
import member from './components/tabbar/Member.vue'
import shopCar from './components/tabbar/ShopCar.vue'
import newList from './components/news/newList.vue'
import newsInfo from './components/news/newsInfo.vue'


// 3. 创建路由对象
var router = new VueRouter({
  // 配置路由规则
  routes: [
    {path:'/', redirect:'./home'},
    {path:'/home', component:home},
    {path:'/search', component:search},
    {path:'/member', component:member},
    {path:'/shopCar', component:shopCar},
    {path:'/home/newList', component:newList},
    {path:'/home/newsInfo/:id', component:newsInfo}
  ],
  linkActiveClass:'mui-active',
})

// 把路由对象暴露出去
export default router